package com.mobimap.nhom9.dao.table;

import android.database.Cursor;

import com.mobimap.nhom9.dto.StreetSegmentDTO;

public class StreetSegmentTable implements ITable<StreetSegmentDTO> {
	
	private static final String[] columns = new String[] { "StartPoint",
			"EndPoint", "TwoWay", "IDStreet", "[Order]" };

	public String getName() {

		return "StreetSegment";
	}

	public String[] getColumns() {

		return columns;
	}

	public StreetSegmentDTO cusorToDTO(Cursor cursor) {
		StreetSegmentDTO dto = new StreetSegmentDTO();
		dto.setStartPoint(cursor.getInt(0));
		dto.setEndPoint(cursor.getInt(1));
		dto.setTwoWay(cursor.getInt(2) == 1);
		dto.setStreetId(cursor.getInt(3));
		dto.setOrder(cursor.getInt(4));
		return dto;
	}
}
